package com.ry.rabbitmq.service;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProduceService {

	@Autowired
    RabbitTemplate rabbitTemplate;
	
    public void sendMail(String queue, String message) {
//        rabbitTemplate.setQueue(queue);
        rabbitTemplate.convertAndSend(queue, message);
    }

    public void sendMail(String queue, String key, String message) {
        rabbitTemplate.convertAndSend(queue, key, message);
    }

//    public void sendMail(String queue, Mail mail) {
//        rabbitTemplate.setQueue(queue);
//        rabbitTemplate.convertAndSend(queue,mail);
//    }
    
}
